vcNavUnit
A navigation unit used for maintaing vcNavAgents and a single navigation mesh. The mesh defines the walkable areas for the agents in the unit. All agents in the unit share the same navigation mesh. Agents within the same unit can avoid each other during navigation.
See in: Overview
Module: vcCore
Parent: vcObject
Children -
Referenced by: vcNavigation.NavUnits, vcNavigation.createNavUnit(), vcNavigation.findNavUnit()
Properties
Learn how to use properties here. The properties are also inherited from the parent class.
| Name | Type | Access | Description |
| Agents | list[vcNavAgent] | R | Gets a list of vcNavAgents in this unit. |
| Id | String | RW | Gets or sets an unique id for this vcNavUnit |
Methods
Learn how to use methods here. The methods are also inherited from the parent class.
| Name | Return Type | Parameters | Description |
| addObstacle | None | vcMatrix center, vcVector boundDiagonal | Adds a rectangular obstacle for navigation agents.See moreParameters: center (vcMatrix): The bound center position of the obstacle expressed in World. boundDiagonal (vcVector): The dimensions of the obstacle (AABB). |
| addPathway | None | vcMatrix center, Real bx, Real by, Optional Keyword[fromPoint = vcVector], Optional Keyword[toPoint = vcVector], Optional Keyword[areaId = Integer] | Adds a pathway for navigation agents.See moreParameters: center (vcMatrix): The center matrix of the pathway expressed in World. bx (float): The half-width of the pathway in the local X direction. by (float): The half-width of the pathway in the local Y direction. Optional: fromPoint (vcVector): For a directional pathway, defines the start (enter) point for the direction definition. Optional: toPoint (vcVector): For a directional pathway, defines the end (exit) point for the direction definition. Optional: areaId (int): An identifier for the pathway. Set for restricted pathways. Multiple pathways can share the same areaId. |
| addPathway | None | vcMatrix center, List[vcVector] verts, Optional Keyword[fromPoint = vcVector], Optional Keyword[toPoint = vcVector], Optional Keyword[areaId = Integer] | Adds a pathway for navigation agents.See moreParameters: center (vcMatrix): The center matrix of the pathway expressed in World. verts (list[vcVector]): Vertices of the pathway polygon expressed in the local coordinates and in CCW (around +Z) order. Optional: fromPoint (vcVector): For a directional pathway, defines the start (enter) point for the direction definition. Optional: toPoint (vcVector): For a directional pathway, defines the end (exit) point for the direction definition. Optional: areaId (int): An identifier for the pathway. Set for restricted pathways. Multiple pathways can share the same areaId. |
| buildMap | Boolean | Real maxAgentRadius, Real maxAgentHeight, Real walkableHeight, Boolean keepMeshData | Builds the navigation mesh based on the added pathways, obstacles, and the given agent parameters.See moreParameters: maxAgentRadius (float): The maximum radius of the navigation agents [mm]. maxAgentHeight (float): The maximum height of the navigation agents [mm]. walkableHeight (float): The maximum traversible ledge height for the navigation mesh [mm]. keepMeshData (bool): Set to True to keep the mesh data for later visualization or debugging. Set to False to release the mesh data after building the navigation mesh. Keeping the mesh data will consume more memory. |
| clearMap | None | None | Clears the navigation mesh data including pathways and obstacle definitions. |
| createAgent | vcNavAgent | vcComponent component | Creates or retrieves a navigation agent for the given component.See moreParameters: component (vcComponent): The component to create the agent for. The agent is unique per component. Returns: vcNavAgent: The created or existing navigation agent. |
| delete | None | None | Deletes this vcNavUnit. |